﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SurvivalStrategy.WorldData.Colliders;

namespace SurvivalStrategy.Entities.EnitityComponents
{
    class EntitiyCollider : EntitiyComponent
    {
        private RectangleCollider startCollider;
        private RectangleCollider collider;
        public RectangleCollider Collider 
        {
            get
            {
                int x = (int)(this.owner.WorldInfo.Position.X + startCollider.rectangle.X);
                int y = (int)(this.owner.WorldInfo.Position.Z + startCollider.rectangle.Y);
                collider.rectangle = new Microsoft.Xna.Framework.Rectangle(x, y, startCollider.rectangle.Width, startCollider.rectangle.Height);
                return collider;
            }
        }

            public void SetCollider(RectangleCollider collider)
            {
                this.startCollider = new RectangleCollider(collider.rectangle.X, collider.rectangle.Y, collider.rectangle.Width, collider.rectangle.Height);
                this.collider = collider;
            }

    }
}
